﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Management.Automation;

using ESF.MUP.BasePlatform;
using ESF.MUP.BasePlatform.Services;
using ESF.MUP.BasePlatform.ApplicationServices.Interfaces;
using ESF.MUP.BasePlatform.Domain.Model;
//using ESF.MUP.BasePlatform.DbService;
//using ESF.MUP.BasePlatform.DbService.MSSQL;


namespace ESF.MUP.Powershell
{
    [Cmdlet(VerbsCommon.Get, "EnvironmentApplicatif")]
    public class GetEnvironment : BaseCmdlet
    {

        [Parameter(Mandatory = false)]
        public String Name { get; set; }


        protected override void ProcessRecord()
        {

            //IEnvironmentService envSvc = MiddlewareManagementService.Current.GetEnvironmentService();
            //System.Data.SqlClient.SqlConnection cn = new System.Data.SqlClient.SqlConnection(@"data source=.\ESF;initial catalog=ESF_MUP_BasePlatformRepository;integrated security=True");
            //ESF.MUP.BasePlatform.DbRepository.MSSQL.SqlContext ctx = new BasePlatform.DbRepository.MSSQL.SqlContext(cn);

            //ESF.MUP.BasePlatform.DbRepositories.EnvironmentRepository repo = new BasePlatform.DbRepositories.EnvironmentRepository(ctx);

            //ESF.MUP.BasePlatform.Services.EnvironmentManagementService svc = new EnvironmentManagementService(repo);

            //if (String.IsNullOrEmpty(this.Name))
            //{
            //    this.WriteObject(svc.GetAll());
            //}
            //else
            //{
            //    this.WriteObject(svc.FindEnvironment(this.Name));
            //}

        }
    }
}
